#include <stdio.h>
// 定义便宜量为8 ，使用unsigned short类型，2个Bit，
// 第一个Bit表示index,第二个bit表示subIndex
#define STAGE_OFF  (8)
#define MK_STAGE(stage)     (stage << STAGE_OFF)
#define MK_STAGE_REL (MK_STAGE(2)) // 只使用第一个Bit的设置
#define MK_STAGE_PRO(subStage) (Mk_STAGE(1) | subStage)

#define GET_STAGE(stepIndex) (stepIndex >> 8 & 0xFF)
#define Get_SUB_STAGE(stepIndex) (stepIndex & 0xFF)

int main()
{
    printf("----------%d----\n", MK_STAGE_REL);
    
    printf("----------%d----\n", GET_STAGE(MK_STAGE_REL));

    printf("-----------------------------\n");
    unsigned short cov = 0 << 8;
    printf("==cov==%d\n", cov);
    printf("==get cov==%d\n", cov >> 8 & 0xFF);

    unsigned short pro1 = (1 << 8) | 0;
    printf("==pro1==%d\n", pro1);
    printf("==get pro1==%d\n", pro1 >> 8 & 0xFF);
    printf("==get sub pro1==%d\n", pro1 & 0xFF);

    unsigned short pro2 = (1 << 8) | 1;
    printf("==pro2==%d\n", pro2);
    printf("==get pro2==%d\n", pro2 >> 8 & 0xFF);
    printf("==get sub pro2==%d\n", pro2 & 0xFF);

    unsigned short pro3 = (1 << 8) | 2;
    printf("==pro3==%d\n", pro3);

    unsigned short rel = 3 << 8;
    printf("==rel==%d\n", rel);

    return 0; // 返回 0
}
